﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Object.aspx.cs" Inherits="PR.UI.Web.RamanSyrtsou.Object" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>PR: Менеджер объектов.</title>
</head>

<script language="javascript" type="text/javascript">
    var popup = null;
    
    function OpenDescriptionPopup(descriptionId, objectId)
    {
        popup = window.showModalDialog("Description.aspx?descriptionId=" + descriptionId + "&objectId=" + objectId, "popup", "height=250,width=250,toolbar=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,modal=yes");
        window.location.reload();
    }
</script>

<body>
    <form runat="server">
        <div>
            <table border="0" cellpadding="3" cellspacing="0">
                <tr>
                    <td><a href="Default.aspx">Назад</a></td>
                    <td><asp:LinkButton runat="server" ID="SaveButton" Text="Сохранить" 
                            onclick="SaveButton_Click"/></td>
                    <td><asp:LinkButton runat="server" ID="DeleteButton" Text="Удалить"/></td>                
                </tr>
            </table>
            <asp:HiddenField runat="server" ID="CurrentPRObjectID" />
            <table border="0" cellpadding="3" cellspacing="0">
                <tr>
                    <td>Название:</td>
                    <td><asp:TextBox runat="server" ID="Name" /></td>
                </tr>                
                <tr>
                    <td>Категория:</td>
                    <td><asp:DropDownList runat="server" ID="Category" /></td>
                </tr>               
                <tr>
                    <td>Тип:</td>
                    <td><asp:DropDownList runat="server" ID="Type" /></td>
                </tr>               
                <tr>
                    <td valign="top">
                        Описания:<br/>
                        <a href="#" onclick="OpenDescriptionPopup(0, <%=CurrentObject.ID %>);">добавить</a>
                    </td>
                    <td>
                        <asp:Repeater runat="server" ID="Descriptions">
                            <HeaderTemplate>
                                <table border="0" cellpadding="3" cellspacing="0" width="100%">
                            </HeaderTemplate>
                            
                            <ItemTemplate>
                                    <tr>
                                        <td><%#DataBinder.Eval(Container.DataItem, "Text")%></td>
                                        <td><a href=javascript:OpenDescriptionPopup(<%#DataBinder.Eval(Container.DataItem, "ID")%>,<%=CurrentObject.ID %>)>редактировать</a>|<a href="Object.aspx?action=deleteDescription&descriptionId=<%#DataBinder.Eval(Container.DataItem, "ID")%>&id=<%=CurrentObject.ID %>">удалить</a></td>
                                    </tr>
                            </ItemTemplate>
                            
                            <FooterTemplate></table></FooterTemplate>
                        </asp:Repeater>
                    </td>
                </tr>
            </table>
        </div>
    </form>
</body>
</html>
